﻿@model VisaApp.Models.TinOfMenuModel
@{  AjaxOptions ajaxOpts = new AjaxOptions
    {
        HttpMethod = "post",
        OnComplete = "completedAjaxRequestCustoer"
    };
}
@{
    ViewBag.Title = "Add tin menu";
    Layout = "~/Views/Shared/_Admin.cshtml";
}

<script type="text/javascript">

    $(document).ready(function () {

        $("#tabasAddCategory").tabs();

        $(".ckeditorCode").cleditor({ width: 550, height: 600, useCSS: true });

        var thumb = $("img#imgLogo");
        var button = $("#event-logo-upload")[0];
        var uploader = new qq.FileUploader({
            element: button,
            allowedExtensions: ['jpg', 'jpeg', 'png', 'gif'],
            sizeLimit: 2147483647, // max size
            action: '/News/UploadImageStr',
            multiple: false,
            onSubmit: function (file, extension) {
                //$('div.preview').addClass('loading');
            },
            onComplete: function (id, fileName, responseJSON) {
                $("#imagesModel").val(responseJSON.filePath);
                thumb.attr('src', responseJSON.filePath);
                thumb.css('display', 'block');
            }
        });

    });


    function onchangeListChaulucAdd() {
        var valueId = $("#Listmenu").val();
        $("#CateId").val(valueId);

        return false;
    }
    
    
</script>
@using (Ajax.BeginForm("_AdduPDATETinOfMenu", "Quantri", null, ajaxOpts, new { enctype = "multipart/form-data" }))
{
    <div class="section-header">
        <div class="options">
            <a href="/Quantri/IndexTinOfMenu">Trở về danh sách tin tức</a>
            <button type="submit" name="save" value="save" class="t-button">
                Save</button>
        </div>
    </div>
    <div id="tabasAddCategory">
        <ul>
            <li><a href="#tabs-1">Thông tin</a></li>
            <li><a href="#tabs-2">Seo</a></li>
        </ul>
        <div id="tabs-1">
            <table>
                <tr>
                    <td colspan="2">
                        @Html.HiddenFor(model => model.Images, new { id = "imagesModel" })
                        @Html.HiddenFor(model => model.Id, new { id = "topicID" })
                        @Html.HiddenFor(model => model.DateCreate)
                         @Html.HiddenFor(model => model.CateId)
                        <div class="warning-area">
                        </div>
                    </td>
                </tr>
                <tr>
                    <td class="adminTitle">
                        @Html.LabelFor(model => model.CateId, "Chuyên mục menu"):
                    </td>
                    <td class="adminData">
                       @Html.DropDownList("ListmenuAdd", null, new { id = "Listmenu", onchange = "onchangeListChaulucAdd()" })
                    </td>
                </tr>
                <tr>
                    <td class="adminTitle">
                        @Html.LabelFor(model => model.Name):
                    </td>
                    <td class="adminData">
                        @Html.TextBoxFor(model => Model.Name, new { @style = "width:500px" })
                        @Html.ValidationMessageFor(model => model.Name)
                    </td>
                </tr>
                <tr>
                    <td class="adminTitle">
                        @Html.LabelFor(model => model.Description, " Mô tả"):
                    </td>
                    <td class="adminData">
                        @Html.TextAreaFor(model => model.Description, new { @style = "width:500px; height:100px" })
                        @Html.ValidationMessageFor(model => model.Description)
                    </td>
                </tr>
                <tr>
                    <td class="adminTitle">
                        @Html.LabelFor(model => model.DescriptFull, "Nội dung"):
                    </td>
                    <td class="adminData">
                        @Html.TextAreaFor(model => model.DescriptFull, new { @cols = "10", @class = "ckeditorCode", @rows = "30", @id = "ckeditorCode" })
                        @Html.ValidationMessageFor(model => model.DescriptFull)
                    </td>
                </tr>
                <tr>
                    <td class="adminTitle">
                        @Html.LabelFor(model => model.Images, " Hình ảnh"):
                    </td>
                    <td class="adminData">
                        <div id="event-logo-upload" style="">
                        </div>
                        <img src="" id="imgLogo" width="100px" height="70px" />
                    </td>
                </tr>
                <tr>
                    <td class="adminTitle">
                        @Html.LabelFor(model => model.ALowHome, "Cho phép hiển thị Trang chủ"):
                    </td>
                    <td class="adminData">
                        @Html.EditorFor(x => x.ALowHome, new { @style = "width:600px" })
                        @Html.ValidationMessageFor(model => model.ALowHome)
                    </td>
                </tr>
                <tr>
                    <td class="adminTitle">
                        @Html.LabelFor(model => model.Status, "Trạng thái tin"):
                    </td>
                    <td class="adminData">
                        @Html.EditorFor(x => x.Status, new { @style = "width:600px" })
                        @Html.ValidationMessageFor(model => model.Status)
                    </td>
                </tr>
            </table>
        </div>
        <div id="tabs-2">
            <div style="padding: 10px">
                <h2>
                    Seo</h2>
            </div>
            <table>
                <tr>
                    <td class="adminTitle">
                        @Html.LabelFor(model => model.MetaDescription):
                    </td>
                    <td class="adminData">
                        @Html.TextBoxFor(model => Model.MetaDescription, new { @style = "width:600px; height:50px" })
                        @Html.ValidationMessageFor(model => model.MetaDescription)
                    </td>
                </tr>
                <tr>
                    <td class="adminTitle">
                        @Html.LabelFor(model => model.MetaKeywords):
                    </td>
                    <td class="adminData">
                        @Html.TextBoxFor(x => x.MetaKeywords, new { @style = "width:600px; height:50px" })
                        @Html.ValidationMessageFor(model => model.MetaKeywords)
                    </td>
                </tr>
                <tr>
                    <td class="adminTitle">
                        @Html.LabelFor(model => model.MetaTitle):
                    </td>
                    <td class="adminData">
                        @Html.TextBoxFor(x => x.MetaTitle, new { @style = "width:600px; height:50px" })
                        @Html.ValidationMessageFor(model => model.MetaTitle)
                    </td>
                </tr>
            </table>
        </div>
    </div>
    
   
   
}
